<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
	function show() {
		document.getElementById('newdetail').style.display = "block";
		InsertJSSkill.skillID.selectedIndex = 0;
	}
	function hide() {
		document.getElementById('newdetail').style.display = "none";
	}

	function Blank_TextField_Validator() {

		if (InsertCourse.courseName.value == "") {
			alert("Please enter course name.");
			InsertCourse.courseName.focus();
			return (false);
		}

		if (InsertCourse.description.value == "") {
			alert("Please enter description.");
			InsertCourse.description.focus();
			return (false);
		}

		if (InsertCourse.noOfMonths.value == "") {
			alert("Please enter number of months.");
			InsertCourse.noOfMonths.focus();
			return (false);
		}

		if (InsertCourse.cost.value == "") {
			alert("Please enter cost.");
			InsertCourse.cost.focus();
			return (false);
		}

		return (true);
	}

	$(function() {
		$('.chzn-select').chosen();
		$('.chzn-select-deselect').chosen({
			allow_single_deselect : true
		});
	});
</script>
</head>
<body onload="hide()">
	<div class="container-fluid">
		<div class="row-fluid">

			<!-- 			<div class="span6 offset3">
				<ul class="nav nav-pills">
					<li><a href="EditJSProfile">Basic Details</a></li>
					<li><a href="EditJSEQ">Educational Qualifications</a></li>
					<li><a href="EditJSWorkEx">Work Experience</a></li>
					<li class="active"><a href="EditJSSkills">Technical Skills</a>
					</li>
				</ul>
			</div> -->

			<div class="span8 offset2">

				<s:if test="hasActionErrors()">
					<br />
					<s:iterator value="actionErrors">
						<div class="alert alert-error">
							<button type="button" class="close" data-dismiss="alert">&times;</button>
							<s:property />
						</div>
					</s:iterator>
				</s:if>

				<br />
				<div align="center">
					<font size="5" face="Georgia"><b>Courses Offered</b> </font> <br />
					<br /> <br />
				</div>

				<table
					class="table-bank table-bank-bordered table-bank-hover table-bank-striped">
					<tr>
						<th style="text-align: center"><font size="4" face="Georgia">Course
								Name</font>
						</th>
						<th style="text-align: center"><font size="4" face="Georgia">Description</font>
						</th>
						<th style="text-align: center"><font size="4" face="Georgia">No
								of Months</font>
						</th>
						<th style="text-align: center"><font size="4" face="Georgia">Cost</font>
						</th>
						<th style="text-align: center"><font size="4" face="Georgia">Delete</font>
						</th>
						
					</tr>
					<s:iterator value="courseList">
						<tr>
							<td style="text-align: center"><s:property
									value="courseName" /></td>
							<td style="text-align: center"><s:property
									value="description" /></td>
							<td style="text-align: center"><s:property
									value="noOfMonths" /></td>
							<td style="text-align: center"><s:property value="cost" />
							</td>
							
							<td style="text-align: center"><a
								href="deleteCourse?courseID=<s:property
									value="courseID" />">
									<i class="icon-trash"></i> </a>
							</td>
						</tr>
					</s:iterator>
				</table>
				
				<div align="center">
					<form action="insertCourse" class="form-inline" id="newdetail"
						onsubmit="return Blank_TextField_Validator()" name="InsertCourse">

						<input type="text" class="input-medium" placeholder="Course Name"
							name="courseName"> <input type="text"
							class="input-medium" placeholder="Description" name="description">
						<input type="text" class="input-medium"
							placeholder="No. Of Months" name="noOfMonths"> <input
							type="text" class="input-medium" placeholder="Cost" name="cost">
						<button type="submit" class="btn btn-medium">Save</button>
					</form>
				</div>
				<button class="btn btn-small btn-primary pull-right" type="button"
					onclick="show()">Add Row</button>
			</div>
		</div>
	</div>
</body>
</html>